<?php

/**

 * @package JoomlaStats

 * @copyright Copyright (C) 2004-2009 JoomlaStats Team. All rights reserved.

 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL

 */







// no direct access

defined('_JEXEC') or die('Restricted access');





$moduleclass_sfx    = $params->get('moduleclass_sfx', '');

$visualization_type = $params->get('visualization_type');// 0 -1 column table

$v_column_label     = $params->get('v_column_label', 'V:');

$v_column_desc      = $params->get('v_column_desc',  '');

$p_column_label     = $params->get('p_column_label', 'P:');

$p_column_desc      = $params->get('p_column_desc',  '');



/** Variables that You can use in template

* $counter_arr      - array with counters

* $moduleclass_sfx  -

*/




echo '<div class="wrapper1">
<div class="boxTitle"><h3>Visitor Counters</h3></div></div>';


if ($visualization_type != 1 )

{//table with 2 columns (1 column with numbers)
echo '<div style="margin-top:10px;"><span class="bg1-top-right">
<span class="bg1-bottom-left">
<span class="bg1-bottom-right">
<span class="custom-box1-inner">
<span class="custom-box1a">';

    $out = '<table border="0" width="100%" cellpadding="0" cellspacing="0"'. ($moduleclass_sfx?' class="'. $moduleclass_sfx .'"':'') .'>';

    foreach ($counter_arr as $counter)

      $out .= '<tr><td>'.$counter['label'].'</td><td style="text-align: right;">'.$counter['number'].'</td></tr>';

    $out .= '</table>';

}

else

{//table with 3 columns (2 column with numbers)
echo '<span class="bg1-top-right">
<span class="bg1-bottom-left">
<span class="bg1-bottom-right">
<span class="custom-box1-inner">
<span class="custom-box1a">';
    $out = '<table border="0" width="100%" cellpadding="2" cellspacing="0"'. ($moduleclass_sfx?' class="'. $moduleclass_sfx .'"':'') .'>';

    $out .= '<tr><td>&nbsp;</td><td style="text-align: right;" title="'.$v_column_desc.'">'.$v_column_label.'</td><td style="text-align: right;" title="'.$p_column_desc.'">'.$p_column_label.'</td></tr>';

    foreach ($counter_arr as $counter)

    {

      if ( $counter['name'] == 's_date_since' )

          $out .= '<tr><td>'.$counter['label'].'</td><td colspan="2" style="text-align: right;">'.$counter['number'].'</td></tr>';

      else

          $out .= '<tr><td>'.$counter['label'].'</td><td style="text-align: right;">'.$counter['number'].'</td><td style="text-align: right;">'.(isset($counter['p_number'])?$counter['p_number']:'&nbsp;').'</td></tr>';

    }

    $out .= '</table>';

}



echo $out;
echo '</span></span></span></span></span></div>';



